fix: align datacenter enum with valid real-world targets#336
Open
KAJdev wants to merge 2 commits into
Open
Conversation
|
Promptless prepared a documentation update related to this change. Triggered by runpod/flash PR #336 Updated datacenter reference tables and code examples to reflect the removal of four datacenters that lack storage + S3 support ( |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR narrows the DataCenter enum to supported storage/S3 locations, moves it into a dedicated resource module, and updates related imports/tests.
Changes:
- Adds
core/resources/datacenter.pyforDataCenterandCPU_DATACENTERS. - Updates resource imports to use the new datacenter module.
- Refreshes tests to use supported datacenter values and validate new endpoint defaults.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/runpod_flash/core/resources/datacenter.py |
Defines the moved/pruned datacenter enum and CPU datacenter set. |
src/runpod_flash/core/resources/network_volume.py |
Imports DataCenter from the new module. |
src/runpod_flash/core/resources/serverless.py |
Imports datacenter symbols from the new module. |
src/runpod_flash/core/resources/__init__.py |
Re-exports datacenter symbols from the new module. |
src/runpod_flash/endpoint.py |
Adds default datacenter selection for non-CPU endpoint configs. |
tests/unit/test_endpoint.py |
Updates datacenter imports/values and endpoint default tests. |
tests/unit/test_p2_gaps.py |
Updates datacenter import path. |
tests/unit/runtime/test_resource_provisioner.py |
Updates expected supported datacenter values. |
tests/unit/resources/test_serverless.py |
Updates serverless datacenter tests to supported values. |
tests/unit/resources/test_network_volume.py |
Updates datacenter import path. |
tests/unit/cli/commands/build_utils/test_manifest.py |
Updates manifest fixture imports and datacenter values. |
Comments suppressed due to low confidence (1)
src/runpod_flash/endpoint.py:420
- Using a truthiness check here treats explicit falsy values (for example
datacenter=""ordatacenter=[]) the same as an omitted datacenter and silently replaces them with all datacenters. Those inputs would otherwise be rejected or preserved by downstream validation, so this can mask bad configuration instead of surfacing an error; check specifically forNonewhen applying the default.
if not self._is_cpu and not self.is_client and not self.datacenter:
self.datacenter = DataCenter.all()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+419
to
+420
| if not self._is_cpu and not self.is_client and not self.datacenter: | ||
| self.datacenter = DataCenter.all() |
| class DataCenter(str, Enum): | ||
| """Enum representing available RunPod data centers. | ||
|
|
||
| NOTE: these are only datacenters with storage support, and s3 API support. |
| field_serializer, | ||
| model_validator, | ||
| ) | ||
| from .datacenter import DataCenter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
removes data centers from the
DataCenterenum that dont have both storage and s3 support. This should prevent the uncaught "no primary storage mount" error during worker initialization.Also moves the
DataCenterenum out ofnetwork_volume.pyintodatacenter.py.